/**
* Copyright @ 2023 iAuto (Shanghai) Co., Ltd.
* All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are NOT permitted except as agreed by
* iAuto (Shanghai) Co., Ltd.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/


/**
 * @description 主页面统一写这里
 */
import { Card, Spin } from 'antd';
import React, { ReactNode, CSSProperties } from 'react';
import styles from './index.less';

interface IProps {
  children: ReactNode;
  className?: string;
  style?: CSSProperties;
  loading?: boolean;
}

export default ({ children, className = '', style, loading = false, ...resProps }: IProps) => {
  return (
    <div className={`${styles.main} ${className}`} style={style} {...resProps}>
      <Spin spinning={loading}>
        <Card>{children}</Card>
      </Spin>
    </div>
  );
};
